import website from '@/config/website'
export const option = {
  lazy: true,
  tip: false,
  simplePage: true,
  searchShow: true,
  searchMenuSpan: 6,
  tree: true,
  border: true,
  index: true,
  selection: true,
  viewBtn: true,
  menuWidth: 120,
  dialogType: 'drawer',
  dialogClickModal: false,
  align: 'center',
  column: [
    {
      label: '机构名称',
      prop: 'deptName',
      search: true,
      align: 'left',
      headerAlign: 'center',
      rules: [
        {
          required: true,
          message: '请输入机构名称',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '所属租户',
      prop: 'tenantId',
      type: 'tree',
      dicUrl: '/api/blade-system/tenant/select',
      addDisplay: false,
      editDisplay: false,
      viewDisplay: website.tenantMode,
      span: 24,
      props: {
        label: 'tenantName',
        value: 'tenantId'
      },
      hide: !website.tenantMode,
      search: website.tenantMode,
      rules: [
        {
          required: true,
          message: '请输入所属租户',
          trigger: 'click'
        }
      ]
    },
    {
      label: '机构全称',
      prop: 'fullName',
      search: true,
      rules: [
        {
          required: true,
          message: '请输入机构全称',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '上级机构',
      prop: 'parentId',
      dicData: [],
      type: 'tree',
      hide: true,
      addDisabled: false,
      props: {
        label: 'title'
      },
      rules: [
        {
          required: false,
          message: '请选择上级机构',
          trigger: 'click'
        }
      ]
    },
    {
      label: '机构类型',
      type: 'select',
      dicUrl: '/api/blade-system/dict/dictionary?code=org_category',
      props: {
        label: 'dictValue',
        value: 'dictKey'
      },
      dataType: 'number',
      width: 120,
      prop: 'deptCategory',
      slot: true,
      rules: [
        {
          required: true,
          message: '请输入机构类型',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '排序',
      prop: 'sort',
      type: 'number',
      width: 80,
      rules: [
        {
          required: true,
          message: '请输入排序',
          trigger: 'blur'
        }
      ]
    },
    {
      label: '备注',
      prop: 'remark',
      rules: [
        {
          required: false,
          message: '请输入备注',
          trigger: 'blur'
        }
      ],
      hide: true
    }
  ]
}
